<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport"	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" href="../dist/css/pnotify.custom.min.css" />
		<script type="text/javascript" src="../dist/js/lib/jquery-2.2.1.js" ></script>
		<script type="text/javascript" src="../dist/js/pnotify.custom.min.js" ></script>
<title>无标题文档</title>
<style type="text/css">
		html,body{
			margin: 0 auto;
			padding: 0;
			font-family: '宋体';
			background: white;
		}
		nav{
			display: block; 
			width: 100%; 
			height:3rem;
			text-align: center;
			color: white;
			font-weight: bolder;
			position:fixed;
			top: 0;
			z-index: 99999;
		}
		.back{
			position: absolute;
			top: 0.5rem;
			left: 0.4rem;
			width: 30px;
			height: 30px;
		}
		.share{
			position: absolute;
			top: 0.5rem;
			right: 0.4rem;
			width: 30px;
			height: 30px;
		}
		.main{
			position: relative;
			margin-left: 1rem;
			margin-right: 1rem;
			margin-right: 1rems;
			}
			.see_times_icon{
		background: url(../dist/img/market_toolbar_unignore_normal.png) no-repeat center; 
		}
	.in_dox_comm{
		background-size: 30px 30px;
		width: 25px;
		height: 25px;
		display: block;
		float: left;
		padding-left: 1rem;
	}
	.praise_times_icon{
		background: url(../dist/img/feed_video_like.png)  no-repeat center;
	}
	.comment_times_icon{
		background: url(../dist/img/recommen_video_comment.png) no-repeat center;
	}
	.in_box{
			display: inline-flex;
			line-height: 25px;
			font-size: 0.6rem;
	}
	.content{line-height: 1.5rem; margin-top: 1rem; width: 100%; }
	img{max-width: 100%;}
	#item_data_info{
		border-top: solid 1px silver;
		margin-top: 1rem;
		line-height: 3rem;
	}
.totop{
			text-decoration: none;
			width: 30px;
			height: 30px;
			background: blanchedalmond;
			display: block;
			text-align: center;
			line-height: 30px;
			position: fixed;
			bottom: 3rem;
			right:0.4rem;
			border-radius: 50%;
		}
	</style>
	<body id="top">
		<div id='top_bg' style="width: 100%; ">
		 <nav id="nav" >
			<img src="../dist/img/shake_back_normal.png"  class="back" onclick="goback()"/>
			<img src="../dist/img/owner_good_share.png"  class="share" onclick="goFoot()" />
		  </nav>	
		</div>
	
	<div class="main" id='main'>
		
		<div class='content'>
			 <article >
			    <h4 id="title"></h4>
			    <label id="time"></label>
				<label id='class_type'></label>
				<label id="tag"></label>
			  </article>
			  <article id="sum">
			  </article>
			  <article id="info">
			  	
			  </article>
		</div>
		
		 <div id="item_data_info" >
					 		<div class="in_box"><span class="see_times_icon in_dox_comm"></span> <label id="see">20人浏览</label></div>
					 		<div class="in_box"><span class="comment_times_icon in_dox_comm"></span> <label id="comment">评论20次</label></div>
					 		<div class="in_box"><span class="praise_times_icon in_dox_comm" id="mouse_clike_praise"></span> <label id="praise">点赞20次</label></div>
		 </div>
	</div>
	
<p class="totop"  href="#" onclick="goTop()"><b>↑</b></p>
	
<div id="foot" class="bdsharebuttonbox" style="margin-left: 1rem; margin-right: 1rem;"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_mshare" data-cmd="mshare" title="分享到一键分享"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a><a href="#" class="bds_h163" data-cmd="h163" title="分享到网易热"></a><a href="#" class="bds_copy" data-cmd="copy" title="分享到复制网址"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"32"},"share":{},"image":{"viewList":["weixin","sqq","qzone","tsina","tqq","renren","mshare","douban","h163","copy"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["weixin","sqq","qzone","tsina","tqq","renren","mshare","douban","h163","copy"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
   
   <div calss='comment_content'> 
   
   </div>
  </body>
</html>
  <script >
   var localstorage=storagObj();
   var user=JSON.parse(localstorage.getItem('user'));
   var out_y=0;
   
   showItems();
  
  window.onscroll = function(){ 
    var t = document.documentElement.scrollTop || document.body.scrollTop;  
    var top_div = document.getElementById("nav"); 
    if( t >= 200 ) { 
        top_div.style.background ="rgba(240,253,250,0.9)"; 
    } else { 
        top_div.style.background = "rgba(255,255,255,0)"; 
    } 
} 
	  	
   function showItems(){
	   if(!user){
			window.location.href='list.html'
			return;
		}
    var str=localStorage.getItem('diteals');
    var json=JSON.parse(str);
    var top_bg=document.getElementById('top_bg');
    
	    var height=0;
	    if(window.screen.height>800){
			height=window.screen.height/2;
		}else{
			height=window.screen.height/3;
		}
	    top_bg.style.height=height+"px";
	    top_bg.style.background="URL("+json.index_pic+") no-repeat center";
	    top_bg.style.backgroundSize='100% 100%';
   	var  title=document.getElementById('title');
    	 title.innerText=json.title;
   	var  sum=document.getElementById('sum');
    	 sum.innerText=json.summary;
    var  info=document.getElementById('info');
    	 info.innerText=json.content;
    var  time=document.getElementById('time');
    	 time.innerText=json.create_time; 
    var  class_type=document.getElementById('class_type');
    	 class_type.innerText=json.content_type; 	 
    var  tag=document.getElementById('tag');
    	 tag.innerText=json.tag;
    	
    	 var  see=document.getElementById('see');
    	 see.innerText=json.see_count;
    	 
    	 var  comment_times=document.getElementById('comment');
    	 comment_times.innerText=json.comment_times;
    	 
    	 var  praise=document.getElementById('praise');
    	 praise.innerText=json.click_praise;
    	 var mouse_clike_praise=document.getElementById('mouse_clike_praise');
    	 mouse_clike_praise.addEventListener('click',function(){
    
    	 	clickPraise(json.id,1,praise);
    	 },false)
    	 
//  console.log(json.index_pic)
	loadNews(json.id,info,praise)

   }
   function clickPraise(id,addOrdel,praise){
   	  $.ajax({  
		        url: "../praise?action=1&news_id="+id+"&phone="+user.phone+"&addOrdel="+addOrdel,  
		        type: 'get',  
		        async: true,  
		        cache: false,  
		        contentType: false,  
		        processData: false,  
		        success: function (returndata) {
		            var list=JSON.parse(returndata);
		             console.log(list)
		            if(list[0].code=='10010'){
		                praise.innerHTML= list[1].click_praise;	
		                msg(list[0].msg,'success');
		            }else{
		            	msg(list[0].msg,'error');
		            	
		            }
		          
		        },  
		        error: function (returndata) {  
		        	msg("加载失败",'error');
		        }  
		    });
   }
   function msg(str,tp){
	   
	   var notice= new PNotify({
		    title: '提示信息',
		    text: str,
		    type: tp,
		     buttons: {
		        closer: false,
		        sticker: false
		    }
		});
		setTimeout(function(){
			notice.remove();
		},1000)
   }
   	function loadNews(id,info){
		  $.ajax({  
		        url: "../news?action=2&id="+id+"&&phone="+user.user_phone,  
		        type: 'get',  
		        async: true,  
		        cache: false,  
		        contentType: false,  
		        processData: false,  
		        success: function (returndata) {
		           var list=JSON.parse(returndata);
		           info.innerHTML= list[1].content;
		        },  
		        error: function (returndata) {  
		        	msg("加载失败",'error');
		        }  
		    });
	}
	function storagObj(){
	// Check browser support
	if (typeof(Storage) !== "undefined") {
	    // Store
//	    localStorage.setItem("lastname", "Gates");
	    // Retrieve
//	    alert(localStorage.getItem("lastname"))
        return localStorage;
	 } 
	}
	
	function goback(){
		window.opener=null;
		window.open('','_self');
		window.close();
		window.history.back(1);
		window.AndroidWebView.showInfoFromJs('返回')
	}
	function goTop(){
		$(document).scrollTop(0); 
	}
	function goFoot(){
//		$("body").animate({
////			'scrollTop' : "+="+window.innerHeight+"px"//一段一段滚动
//			'scrollTop' : "+="+window.innerHeight+"px"
//		}, 1000); 
			//滚动到底部
            var h = $(document).height()-$(window).height();
            $(document).scrollTop(h); 
	}
//打开
</script>